﻿Imports OpenNETCF.Compression.CAB

Public Class SkipFileInstaller
    Inherits WinCEInstallerFile

    Private m_skipFiles As String()
    Sub New(ByVal cabFileName As String, ByVal skipFileList As String())
        MyBase.New(cabFileName)

        m_skipFiles = skipFileList
    End Sub

    Public Overrides Sub OnInstallFile(ByRef fileInfo As OpenNETCF.Compression.CAB.FileInstallInfo, ByRef skipped As Boolean)
        ' see if this is a file we should skip
        For Each skipFile As String In m_skipFiles
            If String.Compare(skipFile, fileInfo.FileName, True) = 0 Then
                ' skip the file by returning (i.e. not calling the base function
                Return
            End If
        Next

        ' install the file by calling the base
        MyBase.OnInstallFile(fileInfo, skipped)
    End Sub
End Class
